1. Field of the Invention
The present invention relates generally to computer hard disk drives, and more particularly to the management of data transfer to and from computer hard disk drive buffers.
2. Description of the Related Art
Many, if not most, computer disk drives incorporate a solid state data buffer in addition to the main optical or magnetic data storage medium on the disk. Solid state data buffers are used to improve disk performance by increasing the speed with which data is transferred between the disk drive and its host computer.
Typically, the solid state buffer of a computer disk drive is used to improve the disk drive performance in two ways. First, after the disk drive has transferred data from a particular sector of the disk to the host computer in conformance with a request for the data, the drive continues to "read ahead", i.e., copy, data from the disk into the buffer. Specifically, the drive copies data into the buffer from sectors on the disk that are adjacent to the sector from which the read data had been extracted. This makes sense with modern computer architectures, wherein a strong likelihood exists that subsequent requests for data will require data from disk sectors adjacent the sector which was used to service the original request.
If indeed a subsequent request for data in one of the adjacent disk sectors is received, the request can be satisfied much more quickly by transferring the data from the solid state buffer to the computer, instead of from the disk itself to the computer. In large part, this is because data transfer between a disk and a computer usually requires the mechanical repositioning of one or more disk drive components, whereas data transfer between a solid state data buffer and the computer requires no such mechanical operations.
Of course, a subsequent request for data may be made which does not require data that has been read-ahead into the buffer. When this occurs, the read-ahead operation can be preempted by the disk drive in favor of immediately servicing the data request from the disk. Such an operation, undertaken pursuant to what is familiarly referred to as a "preempt policy", may make sense because no guarantee exists that subsequent requests for data can indeed be satisfied from the buffer. Stated differently, the disk drive can preempt buffer read-ahead and thereby sacrifice response time for servicing a future request in order to immediately service a current request from the disk.
Alternatively, the disk drive can employ a so-called "no-preempt" policy in which the read-ahead operation is allowed to continue in the presence of a request for disk data. A no-preempt policy makes sense when it is advantageous to delay servicing the current request for data to improve the response time of the disk drive for potential future requests for data. In either case, it is clear that a trade-off exists in selecting whether to preempt data read-ahead into a solid state buffer.
The best policy depends upon the workload and becomes more important as the request rate increases. Unfortunately, once established, the preemption policy of choice is not ordinarily changed. Consequently, for example, a read-ahead "preempt" policy selected on the basis of an expected low data request rate is ineffective in increasing disk drive response time when the data request rate suddenly increases. Under such circumstances, the disk drive policy of "preempt" results in interrupting buffer read-ahead precisely when read-ahead is most desirable.
In addition to data read-ahead, a second way in which solid state data buffers improve disk drive performance is by temporarily "caching", i.e., storing, computer data that is intended to be "written", i.e., stored, on the disk. More particularly, the buffer receives the data from the computer and stores the data until appropriate mechanical repositioning of disk drive components is effected to support writing the data onto the disk. Once the components have been repositioned, the data is written from the buffer to the disk.
Importantly, however, the disk drive does not wait until the data has been written to the disk to report to the computer that the data write has been completed. Instead, the disk drive reports completion of the data write immediately upon receipt of the data in the buffer, thereby greatly improving the response time of the disk drive.
Like computer read requests, computer write requests can give rise to situations wherein it is desirable to preempt certain operations in favor of other operations. For example, it is typically the case that upon receipt of write request data into the buffer for subsequent transfer to the disk, data read-ahead from the disk to the buffer will be preempted to immediately complete the write request. As discussed above, however, preemption of data read-ahead is not without its potential future costs.
Similarly, upon receipt of a read request during a buffer-to-disk write operation, the read request will be delayed until completion of the write operation. By delaying servicing of the read request until the completion of the write operation, repeated interruptions of disk operations and, hence, repeated, time-consuming repositioning of the input/output components of the disk drive is avoided. Nevertheless, servicing of the read request is unfortunately delayed as a result.
As recognized by the present invention, however, it is possible to alleviate the above-discussed problems. Accordingly, it is an object of the present invention to provide a computer disk drive system with buffer wherein the preemption policy of data read-ahead into the buffer is selectively established. Another object of the present invention is to provide a computer disk drive system with buffer wherein a read request from the computer can be satisfied during a buffer-to-disk write operation. Still another object of the present invention is to provide a computer disk drive system with buffer wherein data read-ahead into the buffer can continue in the presence of a write request from the computer. Yet another object of the present invention is to provide a computer disk drive system with buffer which is easy to use and cost-effective.